import Nerv from "nervjs";
import Taro from "@tarojs/taro-h5";
import { View } from '@tarojs/components';
import useBasePage from '../basePage/useBasePage';
import { redirectToPage } from '../../utils/index';
import { AtAvatar, AtCard } from 'taro-ui';
import Store from "../../store/index";
const { fileCdn } = Store;

class Member extends Taro.Component {
  render() {
    const { params } = Taro.useRouter();
    const { onload, awtRs } = useBasePage();
    const [pageTitle, setPageTitle] = Taro.useState('会员中心');
    const [userName, setUserName] = Taro.useState('kyan');
    Taro.useEffect(() => {
      onload(async () => {
        console.log('参数：', params);
        setUserName('王老菊');
      }, pageTitle);
    }, []);
    return <View className="page page-fixed">
      <AtAvatar image={fileCdn + 'img/200'} circle customStyle={{ margin: '0 auto' }} size="large"></AtAvatar>
      <AtCard extra={userName} title="欢迎用户：">
        <View onClick={() => redirectToPage('/pages/member/login')}>去登录</View>
      </AtCard>
    </View>;
  }

  componentDidMount() {
    super.componentDidMount && super.componentDidMount();
  }

  componentDidShow() {
    super.componentDidShow && super.componentDidShow();
  }

  componentDidHide() {
    super.componentDidHide && super.componentDidHide();
  }

}

export default Member;